<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<title>核算项目--部门修改</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css"
			href="<%=request.getContextPath()%>/css/public.css">
		<link rel="stylesheet" type="text/css"
			href="<%=request.getContextPath()%>/css/baseset/moneykind_input.css">
		<script language="JavaScript"
			src="<%=request.getContextPath()%>/js/public.js"></script>
		<script language="JavaScript"
			src="<%=request.getContextPath()%>/js/validate.js"></script>
	    <script language="javascript">
	      function f_check_phone2(obj)
				{   
				    var regu =/^((([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$)/;    
				    var re = new RegExp(regu);   
				    if (re.test( obj.value )) {   
				      return true;   
				    }   
				    alert("请输入正确的传真号码，区号和号码之间用-隔开"); 
				    obj.focus();  
				    return false;   
				} 
	    </script>
		<script type="text/javascript">
			function validate(){
				var departmentCode = document.getElementById("departmentCode");
				var departmentName = document.getElementById("departmentName");
				
				if (!(isNotNull(departmentCode,'部门代码')&&f_check_NumOrLett(departmentCode,'部门代码')&&f_check_ZhOrNumOrLett(departmentCode,'部门代码')&&f_check_NumLength(departmentCode,'部门代码')))
					return false;		
				if (!(isNotNull(departmentName,'部门名称')&&f_check_ZhOrNumOrLett(departmentName,'部门名称')&&f_check_passwordLength(departmentName,'部门名称',1,25)))
					return false;
			
				
				var departmentPhone = document.getElementById("departmentPhone");
				var departmentFax = document.getElementById("departmentFax");
							
			   	if(!isNull(departmentPhone,'部门电话')){
				  if(!f_check_phone(departmentPhone)) return false;
				 }
			    if(!isNull(departmentFax,'传真')){
				  if(!f_check_phone2(departmentFax)) return false;
				}
			  var memo=document.getElementById("memo");
			    if(!isNull(memo,'备注')){
			       if(!f_check_stringLength(memo,"备注",50)) return false;
			    }
			}
		</script>

	</head>

	<body>
		<div id="info_all" style="width: 284px;">
			<div id="info_top">
				核算项目--部门修改
			</div>
			<div style="width: 270px; margin: 6px;">
				<s:form action="updateDepartment.action" method="post" theme="simple" onsubmit="return validate()">
					<table style="width: 250px; margin-top: 10px; background: #fbfbfb; color: #403040;" align=center>
						<tr>
							<td>
								代码(*)：
							</td>
							<td>
								<s:hidden name="depart.department.departmentId" id="departmentId"></s:hidden>
								<s:textfield name="depart.department.departmentCode" id="departmentCode" size="15"></s:textfield>
							</td>
						</tr>
						<tr>
							<td>
								名称(*)：
							</td>
							<td>
								<s:textfield name="depart.department.departmentName" id="departmentName" size="15" ></s:textfield>
							</td>
						</tr>
						<tr>
							<td>
								部门主管：
							</td>
							<td>
								<s:hidden name="depart.department.PBaseVerifyprojectCandiateId" id="candiateId"></s:hidden>
								<s:textfield name="depart.manager.candiateName" id="candiateName" size="15" readonly="true"></s:textfield>
								<img src="images/kookup.gif" style="cursor:pointer" onclick="openWin('selectCandiate.action','candiate',1050,700,0)">
							</td>
						</tr>
						<tr>
							<td>
								部门电话：<br>
							</td>
							<td>
								<s:textfield name="depart.department.departmentPhone" id="departmentPhone" size="15"></s:textfield>
							</td>
						</tr>
						<tr>
							<td>
								传真：<br>
							</td>
							<td>
								<s:textfield name="depart.department.departmentFax" id="departmentFax" size="15"></s:textfield>
							</td>
						</tr>
						<tr>
							<td>
								核算科目代码：
							</td>
							<td>
								<s:hidden name="depart.department.PBaseAccountbookId" id="accountbookId"></s:hidden>
								<s:textfield name="depart.accountbook.accountbookName" id="accountbookName" size="15" readonly="true"></s:textfield>
								<img src="images/kookup.gif" style="cursor:pointer" onclick="openWin('selectAccountbook.action','accountbook',750,700,0)">								
							</td>
						</tr>
						<tr>
							<td>
								备注：
							</td>
							<td>
								<s:textfield name="depart.department.memo" id="memo" size="15"></s:textfield>
							</td>
						</tr>
						<tr>
							<td>
								<div style="margin: 6px; text-align: center;">
									<s:submit value="保存" onfocus="this.blur()"
										onmouseover="this.className='btnover'"
										onmouseout="this.className='btnout'" id="btnsize"></s:submit>
								</div>
							</td>
							<td>
								<div style="margin: 6px; text-align: center;">
									<input type="button" value="返回" onClick="javascript:history.back()"
										onFocus="this.blur()" onmouseover="this.className='btnover'"
										onmouseout="this.className='btnout'" class="btnsize" />
								</div>
							</td>
						</tr>
				  </table>
				</s:form>
			</div>
	</body>
</html>
